/* $Id: ServiceFacade.java 
 * Copyright (C) 2011, TRAKHEES
 *  
 * Revision History
 *
 * Date  			Author 		    	Remarks
 * ---------------------------------------------------------------------------------
 *
 */
package ae.pcfc.etks.online.common.facade;

import java.util.List;

import ae.pcfc.etks.online.common.vo.AdminApprovalVO;
import ae.pcfc.etks.online.common.vo.AppMetaDataDetailVO;
import ae.pcfc.etks.online.common.vo.ClientRoleVO;
import ae.pcfc.etks.online.common.vo.DepartmentVO;
import ae.pcfc.etks.online.common.vo.PagingVO;
import ae.pcfc.etks.online.common.vo.ProcessVO;
import ae.pcfc.etks.online.common.vo.ServiceRoleVO;
import ae.pcfc.etks.online.common.vo.ServiceVO;
import ae.pcfc.etks.online.common.vo.UserServiceVO;
import ae.pcfc.etks.online.common.vo.UserVO;
import ae.pcfc.etks.online.wf.service.client.vo.LaunchIncidentVO;
import ae.pcfc.etks.online.wf.service.client.vo.UserServiceCompleteStepVO;

public interface ServiceFacade extends Facade {
	
	/**
	 * registerService
	 * Method to service registration
	 * @param serviceVO
	 * @return
	 * boolean
	 */
	public boolean registerService(ServiceVO serviceVO);
	
	/**
	 * deleteServiceById
	 * Method to delete service by service id
	 * @param Id
	 * @return
	 * boolean
	 */
	public boolean deleteServiceById(Long Id);
	
	/**
	 * getServicesList
	 * Method to get all services
	 * @return
	 * List<ServiceVO>
	 */
	public List<ServiceVO> getServicesList();
	
	/**
	 * getServiceByPrimaryKey
	 * Method to get service by primary key
	 * @param Id
	 * @return
	 * ServiceVO
	 */
	public ServiceVO getServiceByPrimaryKey(Long Id);
	
	/**
	 * findServiceByUserNameAndTrakheesId
	 * Method to find the service available for registration by a user
	 * @param userName
	 * @param trakheesId
	 * @return
	 * List<ServiceVO>
	 */
	public List<ServiceVO> findServiceByUserNameAndTrakheesId(String userName, String trakheesId);
	
	/**
	 * addServiceReq
	 * Method to add service registration request
	 * @param userName
	 * @param serviceVOs
	 * @param appMetaDataVO
	 * @return
	 * String
	 */
	public String addServiceReq(String userName, List<ServiceVO> serviceVOs, AppMetaDataDetailVO appMetaDataVO);
	
	/**
	 * findServiceListByIds
	 * Method to find services by service ids
	 * @param ids
	 * @return
	 * List<ServiceVO>
	 */
	public List<ServiceVO> findServiceListByIds(List<Long> ids);
	
	/**
	 * findServiceRequestByApplicationId
	 * Method to find services requested for registration for an application id
	 * @param applicationId
	 * @return
	 * List<ServiceVO>
	 */
	public List<ServiceVO> findServiceRequestByApplicationId(String applicationId);
	
	/**
	 * reviewRegisterService
	 * Method to process admin approval action on the service registration request
	 * @param adminApprovalVO
	 * void
	 * @return 
	 */
	public UserServiceCompleteStepVO reviewRegisterService(AdminApprovalVO adminApprovalVO);
	
	/**
	 * findServiceListByUserName
	 * Method to list of services associated with a user
	 * @param userName
	 * @return
	 * List<ServiceVO>
	 */
	public List<ServiceVO> findServiceListByUserName(String userName);
	
	/**
	 * getServicesListByPagingVO
	 * Method to list of services page based on paging information
	 * @param pagingVO
	 * @return
	 * List<ServiceVO>
	 */
	public List<ServiceVO> getServicesListByPagingVO(PagingVO pagingVO);
	
	/**
	 * registerUserServiceList:	Implementation of registering the UserServiceSecuirty records for a user based on his Services
	 *
	 * @author Dicetek.Ismail
	 * @param	UserServiceVO - Contains the information about the User and the Services
	 * @return	boolean returns true on success
	 */
	public boolean registerUserServiceList(UserServiceVO userServiceVO);

	/**
	 * registerEmployee:	Method to register an Employee to the system 
	 *
	 * @author Dicetek.Ismail
	 * @param	UserVO - Contains the information of the User obtained from the front end
	 * @param	UserServiceVO - Contains information about the services selected from the front end
	 * @return	- 

	 */
	public void registerEmployee(ae.pcfc.etks.online.common.vo.UserVO userVO, UserServiceVO userServiceVO);
	
	/**
	 * updateEmployee:	Method to update the Employee information to the system 
	 *
	 * @author Dicetek.Ismail
	 * @param	UserVO - Contains the information of the User obtained from the front end
	 * @param	UserServiceVO - Contains information about the services selected from the front end
	 * @return	- 
	 */
	public void updateEmployee(ae.pcfc.etks.online.common.vo.UserVO userVO, UserServiceVO userServiceVO);

	/**
	 * findClientRolesByRoleIds:	Method to get the list of ClientRoleVO value objects based on the roleIds
	 *
	 * @author Dicetek.Ismail
	 * @param	List<Integer> - List of roleIds for which ClientRoleVO value objects are requested
	 * @return	- List<ClientRoleVO> - List of ClientRoleVO value objects obtained for the roleIds from the TSC Database
	 */
	public List<ClientRoleVO> findClientRolesByRoleIds(List<Integer> roleIds);

	/**
	 * findServiceDepartmentsByDepartmentId:	Method to get the list of DepartmentVO value objects based on the departmentCodes
	 *
	 * @author Dicetek.Ismail
	 * @param	List<String> - List of departmentCodes for which DepartmentVO value objects are requested
	 * @return	- List<DepartmentVO> - List of DepartmentVO value objects obtained for the departmentCodes from the TSC Database
	 */
	public List<DepartmentVO> findServiceDepartmentsByDepartmentId(List<String> departmentCodes);

	/**
	 * findServiceRolesByServiceType:	Method to get the list of ServiceRoleVO value objects based on the ServiceType
	 * This is used to find the service roles for linking with the user
	 * @author Dicetek.Ismail
	 * @param	String - ServiceType - Internal(I)/External(E)
	 * @return	List<ServiceRoleVO> - List of ServiceRoleVO value objects obtained for the ServiceType
	 */
	public List<ServiceRoleVO> findServiceRolesByServiceType(String serviceType);

	/**
	 * registerInternalStaff:	Method to register an Internal Trakhees Staff to the system 
	 *
	 * @author Dicetek.Ismail
	 * @param	UserVO - Contains the information of the User obtained from the front end
	 * @param	List<Long> - Contains list of Role Ids to which the Internal Trakhees Staff needs to be associated with
	 * @return	- 
	 */
	public void registerInternalStaff(UserVO userVO, List<Long> arrRoles);

	/**
	 * findServiceRolesByUserName:	Method to find the service roles for which an user is associated with. 
	 *
	 * @author Dicetek.Ismail
	 * @param	String - username of the user whose service roles you need
	 * @return	List<ServiceRoleVO> - Contains list of ServiceRoleVO value objects obtained from the database
	 */
	public List<ServiceRoleVO> findServiceRolesByUserName(String strUserName);

	/**
	 * updateInternalStaff:	Method to update an Internal Trakhees Staff in the system 
	 *
	 * @author Dicetek.Ismail
	 * @param	UserVO - Contains the information of the User obtained from the front end
	 * @param	List<Long> - Contains list of Role Ids to which the Internal Trakhees Staff needs to be associated with
	 * @return	- 
	 */
	public void updateInternalStaff(UserVO userVO, List<Long> arrRoles);

	/**
	 * serviceUpdate:	Implementation of Edit Service. This method updates the records in Service and 
	 * its related tables like Service Attr, Service Departments
	 *
	 * @author Dicetek.Ismail
	 * @param	ServiceVO - Contains the information obtained from the front end
	 * @return	returns true on success
	 */
	public boolean serviceUpdate(ServiceVO serviceVO);

	public List<ProcessVO> getProcessList();

	
	
	public void updateWorkflowIncidentVO(LaunchIncidentVO launchIncidVO, List<ServiceVO> serviceVOs);

	public void undoReviewRegisterService(AdminApprovalVO adminApprovalVO);
}
